package p270jp.pxv.android.legacy.view;

import android.content.Context;
import android.util.AttributeSet;
import android.view.View;
import android.widget.FrameLayout;
import p109dj.ErrorInfoView;
import p109dj.LoadingInfoView;
import p109dj.NotFoundInfoView;
import p109dj.TooManyMuteInfoView;
import p270jp.pxv.android.R;
import p370ni.InfoType;

/* renamed from: jp.pxv.android.legacy.view.InfoOverlayView */
/* loaded from: classes2.dex */
public class InfoOverlayView extends FrameLayout {

    /* renamed from: a */
    public InfoType f19097a = InfoType.NONE;

    public InfoOverlayView(Context context, AttributeSet attributeSet) {
        super(context, attributeSet);
    }

    /* renamed from: a */
    public void m4598a() {
        this.f19097a = InfoType.NONE;
        removeAllViews();
    }

    @Deprecated
    /* renamed from: b */
    public void m4597b(InfoType bVar, View.OnClickListener onClickListener) {
        if (bVar.ordinal() != 2) {
            ErrorInfoView aVar = new ErrorInfoView(getContext());
            aVar.setOnErrorReloadTextViewClickListener(onClickListener);
            aVar.setErrorTitleText(getResources().getString(R.string.error_default_title));
            aVar.setLayoutParams(new FrameLayout.LayoutParams(-1, -1));
            removeAllViews();
            addView(aVar);
            return;
        }
        NotFoundInfoView cVar = new NotFoundInfoView(getContext());
        cVar.setLayoutParams(new FrameLayout.LayoutParams(-1, -1));
        removeAllViews();
        addView(cVar);
    }

    /* renamed from: c */
    public final void m4596c(int i, View.OnClickListener onClickListener) {
        ErrorInfoView aVar = new ErrorInfoView(getContext());
        aVar.setOnErrorReloadTextViewClickListener(onClickListener);
        aVar.setErrorTitleText(getResources().getString(i));
        aVar.setLayoutParams(new FrameLayout.LayoutParams(-1, -1));
        removeAllViews();
        addView(aVar);
    }

    /* renamed from: d */
    public void m4595d(InfoType bVar, View.OnClickListener onClickListener) {
        this.f19097a = bVar;
        switch (bVar.ordinal()) {
            case 1:
                LoadingInfoView bVar2 = new LoadingInfoView(getContext());
                bVar2.setLayoutParams(new FrameLayout.LayoutParams(-1, -1));
                removeAllViews();
                addView(bVar2);
                return;
            case 2:
                NotFoundInfoView cVar = new NotFoundInfoView(getContext());
                cVar.setLayoutParams(new FrameLayout.LayoutParams(-1, -1));
                removeAllViews();
                addView(cVar);
                return;
            case 3:
                m4594e(R.string.error_default_title, onClickListener);
                return;
            case 4:
                m4594e(R.string.error_default_title, onClickListener);
                return;
            case 5:
                m4594e(R.string.network_error, onClickListener);
                return;
            case 6:
                m4596c(R.string.error_default_title, onClickListener);
                return;
            case 7:
                m4596c(R.string.network_error, onClickListener);
                return;
            case 8:
                TooManyMuteInfoView gVar = new TooManyMuteInfoView(getContext());
                gVar.setLayoutParams(new FrameLayout.LayoutParams(-1, -1));
                removeAllViews();
                addView(gVar);
                return;
            case 9:
                View invisibleWorkView = new InvisibleWorkView(getContext());
                removeAllViews();
                addView(invisibleWorkView);
                return;
            case 10:
                View overlayMutedWorkView = new OverlayMutedWorkView(getContext());
                removeAllViews();
                addView(overlayMutedWorkView);
                return;
            default:
                return;
        }
    }

    /* renamed from: e */
    public final void m4594e(int i, View.OnClickListener onClickListener) {
        ErrorInfoView aVar = new ErrorInfoView(getContext());
        aVar.setOnErrorReloadTextViewClickListener(onClickListener);
        aVar.setErrorTitleText(getResources().getString(i));
        aVar.f12268a.f24283r.setVisibility(8);
        aVar.setLayoutParams(new FrameLayout.LayoutParams(-1, -1));
        removeAllViews();
        addView(aVar);
    }

    public InfoType getInfoType() {
        return this.f19097a;
    }
}
